package com.cy.service.impl;

import com.cy.dao.CurdDao;
import com.cy.pojo.Curd;
import com.cy.service.CurdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CurdServiceImpl implements CurdService {

    @Autowired
    private CurdDao curdDao;

    @Override
    public List<Curd> find(String name) {

        List<Curd> list = curdDao.find(name);
        return list;
    }

    @Override
    public int deleteById(Integer id) {
        int row = curdDao.deleteById(id);
        return row;
    }

    @Override
    public int insertCurd(Curd curd) {
        int row = curdDao.insertCurd(curd);
        return row;
    }

    @Override
    public int updateCurd(Curd curd) {

        return curdDao.updateBrand(curd);
    }
}
